Fix rules around removing -O2 when compiling with debug.