Build system refactoring
Fix build when gmp isn't installed
Handle dependencies for .cmm files properly