Fix cgo ldflags to support runtime lookup