Makefile: optimize compile options and make GCC 4.9 happy