To embed Python into an application, a new --embed option must be passed to python3-config --libs --embed to get -lpython3.8 (link the application to libpython). To support both 3.8 and older, try python3-config --libs --embed first and fallback to python3-config --libs (without --embed) if the previous command fails.
https://docs.python.org/3/whatsnew/3.8.html#debug-build-uses-the-same-abi-as-release-build says: