lastresort... Um... good effort, but your knowledge of solar chemistry is a bit off.
Stars form from contracting clouds of hydrogen, once the gravity of the presolar mass reaches a critical level, fusion occurs inside the new star, and hydrogen starts getting converted into helium, then the sun goes through its main life cycle just converting hydrogen into helium until it runs out of hydrogen. After that, the sun swells into a red giant, and the core of the sun gets compressed enough for the helium to start fusing, and therefore creating heavier elements.
Depending on the size of the sun, this fusion process stops at a different element stage, be it carbon, or all the way up to uranium, possibly even heavier element that we are unaware of. These elements then get blasted into space by the suns death, or supernova. The shockwave from the blast is powerful enough to sweep through near by nebula and start the process of contraction that will eventuate in a new star or stars being born, and the nebula at the same time gets litered with the elements from that same supernova, so that when the hydrogen contracts, you're left with a ring of heavier elements, which slowly swirl, bump into each other and become planets and asteroids.
As far as life is concerned, at least on this planet, it IS made up of mainly hydrogen, oxygen and carbon. These three elements also happen to be the most common elements in the universe, as well as the fact that most comets are made of these three.
Earth was at one time barren and lifeless, but about 4 billion years ago, scientist believe the earth was bombarded by comets, which is where most of our water comes from. These comets would have brought with them all the essential lighter elements nessisary for life with them from the outer edges of our solar system.
Add all that to the thermo vents at the bottom of the ocean and a few hurdred million years, something is bound to happen with all those chemical reactions taking place!