Scaffold morphing leading to evolution of 2,4-diaminoquinolines and aminopyrazolopyrimidines as inhibitors of the ATP synthesis pathway