Weak lensing in generalized gravity theories