Fix copying dependencies in shared library builds.

We forgot that we might includes target generator syntax in the dependencies to be copied, as in the case where libssh2 is a shared library.