The images installed using python 3.9-dev get installed into
python-config --prefix returns
/usr. This makes python-config unreliable: see for instance this failure.
You can see a working config here: an
LD_LIBRARY_PATH must be specified explicitly for the
-dev package, whereas
python-config --prefix works well for other Python version.
I assume the problem is fixed by specifying the right
./configure is run.