Add NDEBUG to release builds

The NDEBUG flag is used by the standard library to alter the behaviour
of debug functions, e.g. assert()