Fixed compile issues on Windows with Visual Studio 2013.

- Made compiler flags dependent on the compiler being used.
- Added check for clang to use the same compiler options as gnu g++