Variational approach to N -body interactions in finite volume