diff --git a/lib/rbpkg/repos/libffi.rb b/lib/rbpkg/repos/libffi.rb
index a1013c4..69fd7e4 100644
--- a/lib/rbpkg/repos/libffi.rb
+++ b/lib/rbpkg/repos/libffi.rb
@@ -9,7 +9,11 @@ class Rbpkg::Repos::Libffi < Rbpkg::Repo
end
def configure_env
- "MAKE=gmake"
+ if system("which gmake >/dev/null 2>&1")
+ "MAKE=gmake"
+ else
+ super
+ end
end
def dir