python3-config fails when python is installed not system-wide. It doesn't return -L/path/to/libs. pkg-config resurns it. Note that this changes meaning of optional argument to ./configure --enable-python=...