An in-Medium Heavy-Quark Potential from the $Q\bar{Q}$ Free Energy