Periodic solutions for a class of autonomous Hamiltonian systems