build: Fix configuring depends with cmake
build: Fix target name
The second commit fixes an issue I see when trying to build an individual package that has native dependencies. The first one is trivial, but I don't really understand how to reproduce the issue. For Bitcoin Core, it manifested when configurinbg the libmultiprocess package (which we didn't backport yet)
This is a backport of core#24392 and core#19868