--- configure.orig	2016-05-19 14:39:16 UTC
+++ configure
@@ -3910,7 +3910,7 @@ $as_echo_n "checking if we can link with
             ia64-*hp-hpux11* )
                PYTHON_LIBS="-ldld -ldl -lm -Wl,-E ${PYTHON_LIBS}"
                ;;
-            *-freebsd* )
+            *-freebsd* | *-dragonfly* )
                PYTHON_LIBS="-lm -lutil ${PYTHON_LIBS}"
                ;;
          esac
