Synthesis and characterization of some heterocyclic compounds and study of their antimicrobial activities