Added support for different GCC versions.

The issues here is that the flag used to specify the use of the 2011 standard
change from version 4.6 (c++0x) to 4.7 (c++11). This change introduces a query
to determine which version of the compiler is being used and sets the flag
accordingly.