Add linker flags to resolve weak symbols correctly