Use conditional assignment for CXX, CFLAGS and LINK in Makefiles.
Remove -O in Makefile.