Backporting 2 patches from upstream.
The first patch enable automake to look for python versions with
multiple digits when auto-detecting the default system python
interpreter version. The second allows automake to properly pick
automake version (up to python 3.15) when it was specified by the user
and yet different from the default system interpreter.
Resolves: rhbz#2209821