Fix static linking flags to avoid breaking Qt builds