fix compile error and add Makefile