diff --git a/scripts/install.sh b/scripts/install.sh
index 0a6bc4667d9d94c0c831d1cec7e4734ae2c64ac2..1dd0db6ed07e16c06b15ae74e9a33ae036a2de0d 100755
--- a/scripts/install.sh
+++ b/scripts/install.sh
@@ -94,7 +94,7 @@ mkdir -p contrib/native
 )
 
 # Build the daemon itself.
-./autogen.sh
+test -f configure || ./autogen.sh
 
 if [[ "$OSTYPE" != "darwin"* ]]; then
     # Keep the shared libaries on MAC OSX.