build: fix issues when building with GMP