Properly linking libraries for downstream export