autotools: Properly order install dependencies of pam_lastlog2
As pam_lastlog2 is relinked during installation, all its dependencies
need to already be installed.
This is the same issue that affected pylibmount which was fixed in
commit
324330aca644 ("build-sys: Properly order install dependencies of pylibmount").
Extend the logic added in that commit to also apply to pam_lastlog2.
Closes: #3011
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
(cherry picked from commit
20dc72d8c1f3a53c0408858f0046e1849644c710)