ax_pthread: Check for g++ instead of gcc

Surprisingly, ZNC is written in C++, not C and thus needs a C++ compiler, not a
C one.

Signed-off-by: Uli Schlachter <psychon@znc.in>