Replace bash script with makefile