added m4/lib dir, it probably shouldn't be here, but a few changes were needed, also updated the template Makefile accordingly