Fixed build error by using a different cmake function for checking the compiler flags
Fixed linker error on Mac. For clang this check does not recognize that these linkerflags are not support and due to that it gives a linker error
COMP Fixed build error for mac gcc which does not support some gnu linker flags