[bugfix] Fixes GMP test.

Previoulsy CMake always fails to find the __gmpz_abs symbol on my machine, even though it is clearly there.
The test used check_symbol_exists. According to the documentation, check_symbol_exists tries to include the
second argument into a test program to check whether there is a prototype for the first argument, so as the
second argument is a binary, that can't really work... This patch switches over to use check_library_exists.