improved makefiles and build scripts