Calculation of the nuclear overhauser effect and the determination of proton-proton distances in the presence of internal motions