Makefile improvement, cppcheck fixes