in addition to c++ check also for g++ in the path, fixes ROOT-5706.