After some thinking, I found an answer. If one has a better one I'll accept it.
From a cost matrix of shape $n\times m$ with $n<m$, it is easy to add nodes that will not change anything by giving all their incident edges the weight 0, that is adding $(m-n)*m$ edges with weight 0.