Fixes issue with gdb segfaulting when reading debug symbols

Changing the gcc debug optimization level to -gO (enables some optimizations
that do not interfere with debugging). gdb no longer segfaults.