Environmental conditions influence emergence of novel metabolic pathways patched together from promiscuous enzymes