Migrate Makefile over to cmake

Use cmake to generate a Makefile and to detect gmp