Gaah, the infvizglib.o target isn't defined but is dependent of exe, which means the default rule is run, and by default make uses $(CXXFLAGS) when compiling c++ source files not $(CFLAGS). If you want different behavior, either define and use CXXFLAGS, add another rule, or look in the makefile manual( there are other ways).