Oro had it before. There are even theories that not the fourth hokage was in the last coffin when he was fighting Hiruzen. Who knows? Wasn't the fourth hokage sealed? So it was Madara back then as well?
So how did he get the dna? Not sure, he had Hashi's and Tobi's dna as well. Weapons, graves? Or maybe he met ancient Madara and stole a hair? I doubt they worked together but they could have met each other. BUT I seriously doubt what some other guy here posted a while ago. That Oro gave ancient Madara a sharingan eye in exchange for his dna. No way, he would have wanted the eye for himself, sillies!
I assume Obito burried him. And he still uses mountain graveyard as headquarter so I doubt he let Oro walk in there and play with the grave. So I think he had the dna way before, probably from around the time when he fought Hashi. Only way then would be 'weapons'.
It could still be explained if there is a relationship between Oro and Madara but I doubt it. When Kabuto was talking to him, he showed no reaction to the name. And with 'HIS' he clearly meant the fake one, Obito.