Installation error: Could not link test program to Python

I am following the instructions for the installation in a virtual
I run the command:
./configure --prefix=/usr/local/Cellar LDFLAGS="-L/usr/local/lib"
I get the error “Could not link test program to Python” with the suggestion
to pass LIBS or LDFLAGS variables.

From the config.log gives the following error:

clang: error: no such file or directory:

This error occurs in the following line, something to do with

configure:19079: gcc -o conftest -g -O2 -DNDEBUG
-L/usr/local/lib -Wl,-stack_size,1000000 -framework CoreFoundation
Python.framework/Versions/3.6/Python conftest.c
-lpython3.6m -ldl -framework CoreFoundation -ldl -framework
CoreFoundation >&5

I have two questions:
How can I pass the variable for this line?
How can I find out what the right path is?

Thank you,

attachment.html (1.28 KB)

Please post the _complete_ output of configure and config.log, not only
snippets, as they do not tell the whole story. Also, do not forget to tell
us which OS you are using, as well as compiler, Python and boost versions.

(From the kind of error messages you show, I would venture this is related
to the following homebrew bug: )