(Pre-existing) -DNDEBUG should be passed via CPPFLAGS (preprocessor flags) not CFLAGS (C compiler flags).
(CPPFLAGS get passed to some other programs; CFLAGS also gets passed to the linker.)