build: support out of tree builds

Change-Id: Ibf07f1056567eb25106b8039c14e54411243d831
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/configure.ac b/configure.ac
index bba445b..67d7130 100644
--- a/configure.ac
+++ b/configure.ac
@@ -34,6 +34,6 @@
 
 # Create configured output
 AC_CONFIG_FILES([Makefile.interfaces],
-    [./generate_makefile.sh > Makefile.interfaces])
+    [${srcdir}/generate_makefile.sh ${srcdir} > Makefile.interfaces])
 AC_CONFIG_FILES([Makefile])
 AC_OUTPUT
diff --git a/generate_makefile.sh b/generate_makefile.sh
index e0f0511..4816919 100755
--- a/generate_makefile.sh
+++ b/generate_makefile.sh
@@ -1,5 +1,7 @@
 #!/bin/sh
 
+cd $1
+
 toplevel_dirs=xyz
 interfaces=`find $toplevel_dirs -name "*.interface.yaml"`