I'm not a make expert, and the compiler part of Codeblocks isn't my field, but I think you forgot to enable the "this is a custom makefile" in your compiler settings. Otherwise, codeblocks generates the makefile, overwriting the one you just made in the pre-build steps.
Then again, it's just my humble opinion. :mrgreen: