Makefile.pregenerate: improve rebuild checks for db and db-build.

Check not only for updated files (build/*/PKGBUILD, /var/lib/pacman/local/*/*),
but also for modified containing directories (build, /var/lib/pacman/local).

This helps to detect new entries which nevertheless have old mtimes
(i. e. symlinks and `cp -a`).