Fix build with lib64 folder for arch-specific libraries

Claudio Rodrigo Pereyra Diaz confirmed in ranma42/mono@23898816274131a13056ff4bf0c891509d51ade4 that this change fixes the build on Fedora x86_64.

The changes in this PR are the same as in that commit, except for the MIT/X11 clause in the commit message.

To ease backporting, this fix is right on top of the commit that introduced the issue. Nonetheless it currently also merges cleanly to master