diff --git a/configure b/configure
index 6fd3ae86186b06a3ee15d9735870ec7755d47d2d..c3cf948bcb3772e30cd471ca0d74afbf4fbf073b 100755
--- a/configure
+++ b/configure
@@ -985,7 +985,7 @@ int main( void ) { return (lrintf(3.999f) > 0)?0:1; }
 EOF
 
 have_lrintf="no"
-if $cc $extralibs -o $TMPE $TMPC 2> /dev/null ; then
+if $cc $CFLAGS $LDFLAGS $extralibs -o $TMPE $TMPC 2> /dev/null ; then
   have_lrintf="yes"
   # allanc@chickenandporn.com: cannot execute cross-compiled
   # code on the host.  Only execute if not cross-compiling.