Text this: Computing canonical averages with quantum and classical optimizers: Thermodynamic reweighting for QUBO models of physical systems