A modification to the pairwise likelihood method is proposed, which aims to improve the estimation of the marginal distribution parameters. This is achieved by replacing the pairwise likelihood score equations, for estimating such parameters, by the optimal linear combinations of the marginal score functions. A further advantage of the proposed estimator of marginal parameters, over pairwise likelihood, is that it is robust to misspecification of the bivariate distributions as long as the univariate marginal distributions are correctly specified. While alternating logistic regression can be seen as a special case of the proposed method, it is shown that an existing generalization of alternating logistic regression applicable to ordinal data is not the same as and is inferior to the proposed method because it replaces certain conditional densities by pseudodensities that assume working independence. The fitting of the multivariate negative binomial distribution is another scenario involving intractable likelihood that calls for the use of pairwise likelihood methods, and the superiority of the modified method is demonstrated in a simulation study. Two examples, based on the analyses of salamander mating and patient-controlled analgesia data, demonstrate the usefulness of the proposed method. The possibility of combining optimally the pairwise, rather than marginal, scores is also considered and its difficulty and potential are discussed.