Homoclinic solutions for a second-order singular differential equation