Add makefile library support and update some templates