pkg: improve pkg scandir target building