update build script and Makefile