Added -O3 -g option for gcc and clang. Improved compiler checking method.