Allow compiling with clang++ using -std=c++11 flag

configure script should run in c++ mode when checking functions
otherwise clang++ gives an error.
Merge pull request #2956 from southerngs/configure-clang-cpp11-fix

Allow compiling with clang++ using -std=c++11 flag