Near the top of the file there is a loop that populates LDFLAGS, add another check like the following and see if that works:

+    if test -d "$defdir/lib/x86_64-linux-gnu"; then
+        LDFLAGS="$LDFLAGS -L$defdir/lib/x86_64-linux-gnu"
+    fi