Converting scripts to makefiles