Installation error: Could not link test program to Python

Hello,
I am following the instructions for the installation in a virtual
environment.
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:
'Python.framework/Versions/3.6/Python'

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

configure:19079: gcc -o conftest -g -O2 -DNDEBUG
-I/usr/local/Cellar/python3/3.6.3/Frameworks/Python.framework/Versions/3.6/include/python3.6m
-L/usr/local/lib -Wl,-stack_size,1000000 -framework CoreFoundation
Python.framework/Versions/3.6/Python conftest.c
-L/usr/local/opt/python3/Frameworks/Python.framework/Versions/3.6/lib
-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,
Duccio

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:
https://github.com/Homebrew/homebrew-core/issues/21212 )

Best,
Tiago