Update Makefile and remove some compiler warning
Finish logging mechanism