Configurational invariants of Hamiltonian systems