Add makefile in subdirectory and fix some warning in source code