add support for gfortran 4.9 and C++ compiler to configure.sh