Syntheses of functionalized derivatives of quinazolines and 1,4-benzo-diazepines