Disable optimization for Octave tests, to speed up compilation

- Use AX_CHECK_COMPILE_FLAG() macro to check for -O0 compiler flag