Bifurcation for second order Hamiltonian systems with periodic boundary conditions