build: Use $(TargetDir) and $(TargetName) macros for VC .lib output files

As with commit 11397eb6dd, use $(TargetDir) and $(TargetName) for the
Import Library output rather than $(OutDir)\$(ProjectName)d.lib and
$(OutDir)\$(ProjectName).lib.
RELEASE-NOTES: Synced with 2a615a2b64