improve Makefile and script