Support for multiple GCC versions

The flag value used to specify the use of the 2011 standard for C++ changed from version 4.6 to 4.7. These changes query gcc to determine which version it is, and sets the -std flag accordingly.