[Chapel Merge] Adjust Makefile.gnu to account for different gcc/g

Branch: refs/heads/main
Revision: 6ec5754
Author: e-kayrakli
Log Message:

Merge pull request #18033 from e-kayrakli/make-warn-flags-gcc-gpp

Adjust Makefile.gnu to account for different gcc/g++ versions

This PR adjusts two checks in Makefile.gnu to account for different versions of gcc and g++.

Tested with versions 6 to 9, but not with different versions of gcc/g++.

[Reviewed by @ronawho]

Modified Files:
M make/compiler/Makefile.gnu

Compare: https://github.com/chapel-lang/chapel/compare/ab4ed561c8dc...6ec575439c3e