Synthesis of N-heterocycles such as pyrazole, pyrimidine-oxadiazole and attachment of amino acid linkers