Using find_package for flex to deal with FreeBSD having an older, incompatible
version in /usr/bin. will need env PATH=/usr/local/bin:$PATH on FreeBSD to detect
required flex 2.5.37. Using CMake cache variables to link GMP (fixes FreeBSD build).