Generalization of the Ruderman-Kittel-Kasuya-Yosida Interaction for Nonspherical Fermi Surfaces