Fix library resolution to match output via Makefile

To be more correct this should move to `System.mapLibraryName(name)`, but this works for now.