Setting ground potential in nodal analysis matrix form
The usual approach is to simply not write a KCL equation for the ground node. Then use the fact that its potential is defined as 0 when writing equations for the other nodes. This will give a non-singular matrix if you don't do anything else goofy (put two current sources in series, for example).

An equivalent way to look at this is to eliminate the KCL equation for the ground node, and add an equation 
$$V_{\rm gnd}=0.$$

In the first case for a network of N nodes you have N-1 equations and N-1 unknowns. In the second case you have N equations and N unknowns (but one of the unknowns is trivial to find).