improve the error handle, add a Makefile