Added function to autogenerate Makefile