Improve the makefile and test running process