build: fixes a "can't cd to..." issue when installing shared libraries.

The problem is reproducible with a relative prefix path.