refined makefile and shell scripts