We explore a new approach in the rational design of specificity in molecular recognition of small molecules based on statistical-mechanical integral equation theory of molecular liquids in the form of the three-dimensional reference interaction site model with the Kovalenko-Hirata closure (3D-RISM-KH). The numerically stable iterative solution of conventional 3D-RISM equations includes the fragmental decomposition of flexible ligands, which are treated as distinct species in solvent mixtures of arbitrary complexity. The computed density functions for solution (including ligand) molecules are obtained as a set of discrete spatial grids that uniquely describe the continuous solvent-site distribution around the protein solute. Potentials of mean force derived from these distributions define the scoring function interfaced with the AutoDock program for an automated ranking of docked conformations. As a case study in terms of solvent composition, we analyze cooperative interactions encountered in the binding of a flexible thiamine molecule to the prion protein at near-physiological conditions. The predicted location and residency times of computed binding modes are in excellent agreement with the available experimental data.