Molecules in comets: An ISM-solar system connection?