The inverse problem in classical statistical mechanics