Effective Hamiltonian for polyatomic linear molecules