improve Makefile and make-doc script, fix compilation error