Fix another build failure with python 3.8
The parsing of python3-config --ldflags would break if multiple -L
path components were present. This change loops over these paths
until it finds the correct one.
Fixes https://pagure.io/SSSD/sssd/issue/4147
Reviewed-by: Pavel Březina <pbrezina@redhat.com>