The modified Gram--Schmidt algorithm is a well-known and widely used procedure to orthogonalize the column vectors of a given matrix. When applied to ill-conditioned matrices in floating point arithmetic, the orthogonality among the computed vectors may be lost. In this work, we propose an a posteriori reorthogonalization technique based on a rank-k update of the computed vectors. The level of orthogonality of the set of vectors built gets better when k increases and finally reaches the machine precision level for a large enough k. The rank of the update can be tuned in advance to monitor the orthogonality quality. We illustrate the efficiency of this approach in the framework of the seed-GMRES technique for the solution of an unsymmetric linear system with multiple right-hand sides. In particular, we report experiments on numerical simulations in electromagnetic applications where a rank-one update is sufficient to recover a set of vectors orthogonal to machine precision level.