Just to get the facts straight: So you actually are married to two women? And you have a second wife who’s the mother of the baby and who you took along to the embassy to have the birth certified? And you told them you’re married, but not to that woman, which they noticed because your second wife has the same family name as you?
Well, I don’t want to say you’re in serious trouble, but maybe it would be a good idea to consult a lawyer - not just for the birth certificate thing; but in Western societies, bigamy is a criminal offence, and it’s no defence arguing that you were living in another country. You won’t make things better by continuing to lie to the embassy.
As to your question whether embassies have a way of finding out who you are married to: To my knowledge, the U.S. (unlike some other countries maybe) do not have a central marriage database where every concluded marriage is entered and which embassies routinely check when doing business with their citizens; and even if such a database existed, marriages concluded by other countries’ authorities wouldn’t be entered. So chances are you could get along with it for quite a while. Of course, once the embassy gets suspicious, they might dig a bit deeper into it, and then things might be revealed.