Dependence upon the molecular and atomic ground state of higher-order harmonic generation in the few-optical-cycle regime