Adjust default compiler and linker flags when using cmake.

With emscript...en, -O2 is ignored when compiling .bc files, so pass it to linker instead.

This commit removes the warning "emcc: warning: -Ox flags ignored, since not generating JavaScript" that is caused with the default cmake-generated compile flags for release mode. Instead, -O2 is passed to the final link phase, and not .cpp -> .o or .o -> .bc build phases.