build: adjust gcc/g++ version checks for newer apple compilers