Carbon, hydrogen, oxygen, etc, are there, and comets aren't necessarily inert. A comet's tail exists because the heat of the Sun is blasting and melting parts of the icy comet off - who's to say that, in such turbulance, masses of organic molecules don't form?
There's also the case of nebulae and interstellar dust clouds, which can be quite warm if basking in the glow of several newborn, nearby stars - who's to say the basic chemicals from the supernova that created the nebula, the carbon, hydrogen, and oxygen, can't meet and combine in the nebula itself? Who's to say that amino acids aren't produced en masse by simple collisions?
It may seem far-fetched, but the universe operates on such phenomena happening. Heavy elements in stars only exist by infinitely improbable events happening - two molecules, rare beyond rare, colliding in the vastness of a star. But, given sufficient time and numbers, it happens, and it happens a lot.
So, the same is true for organic molecules in stars. It is simply two hydrogen atoms colliding and sticking together, two hydrogen atoms and an oxygen atom colliding and forming water, four hydrogen and a carbon colliding to form methane, etc. As rare as any one collision may be, given the sheer abundance of these materials, it's not surprising that there are enough fortuitous combinations to make masses of complex molecules.