Synthesis of antibacterial and biobased compounds