Complex Least Squares Approximation
Let's assume we have $ m $ points in the Fourier Domain (Discrete Fourier Domain) for our reference frequency response. We'll designate their values by $ y \in \mathbb{C}^{m} $.

Also we need a filter of $ n $ coefficients to approximate the reference response as good as it can. We'll use $ h $ for that.

We need now the Fourier Matrix, $ F \in \mathbb{C}^{m \times n} $ in order to write the following linear complex least squares problem:

$$ \arg \min_{h} \frac{1}{2} {\left\| F h - y \right\|}_{2}^{2} $$

You could easily write this also in a Sum Form.
The nice thing about it is the solution is give by the classic Least Squares solution - $ \hat{h} = {\left( {F}^{H} F \right)}^{-1} {F}^{H} y $.

Of course, in practice, you need many point in frequency domain to add more and more restrictions. You could also write a continuous version of this problem using the DTFT.