add top-level makefile, fix $(PWD) ${CURDIR} issue