Legally, self-defense is generally reserved for imminent danger, not eventual danger. If any sort of self-defense made a killing not eligible for a horcrux, then they would be rather difficult to make; if you kill someone to make a horcrux, then the killing is necessary to make a horcrux, which is necessary to keep yourself from dying, so the killing was done in self-defense. You'd have to use a murder that you were going to do anyway.
It is stated that prophecies can be averted (and averting the prophecy was the whole point of killing Harry), and if Voldemort had stopped going around killing people, then Harry wouldn't have needed to kill him. Claiming self-defense as a justification for murder, when the only reason you need to defend yourself is because of all the other murders you're committing, is not much of an argument (and Harry didn't actually kill Voldemort, he died from the elder wand directing the Avada Kevada he cast trying to kill Harry back to him, so ultimately he wouldn't have died if he hadn't tried to kill Harry).
But the term "murder", as opposed to "homicide", is a legal term. It seems unlikely that a horcrux literally depends on what the legal authorities have declared illegal. Rather, it depends on some metaphysical aspect of the act. Being willing to kill a baby takes a tremendous amount of callousness, even if the baby is destined to be instrumental in your death sixteen years from now.
When Dumbledore tells Snape that he wants Snape to kill him rather than Draco to spare Draco's soul, Snape responds "What about my soul?" Snape was killing Dumbledore knowing that Dumbledore consented to the killing, and Draco was trying to kill Dumbledore to keep Voldemort from killing him, so evidently neither of these extenuating circumstances keep a killing from harming someone's soul (although it is not clarified whether the damage is sufficient to create a horcrux). In the real world, killing someone can be a traumatic experience even if it was justified.