Add BUILD_TYPE option in Makefile and support debug mode