configure: improve diagnostics in case of incorrect gaproot

The resulting code is much simpler than it was before. The big error
message is borrowed from ac_find_gap.m4.

Note: The main reason we are not outright using ac_find_gap.m4 at this
point is that it does not properly deal with the case in which GAP was
built against a system GMP version.