I assume that the rotation will be done by multiplying row vectors on the right by the matrix. In other words, the rotation function will be $(x', y' z') = (x,y,z)\cdot\mathbf R$, where $\mathbf R$ is the rotation matrix.
Let $\mathbf u = (a,b,c)$ be a unit vector in the desired direction. For $\mathbf R$, we simply have to use a rotation matrix that has $(a,b,c)$ as its third row. Then it is easy to check that $(0,0,1) \cdot \mathbf R = (a,b,c)$, so the $z$-axis gets rotated as desired.
The first two rows of $\mathbf R$ can be anything you like, as long as the matrix is orthogonal.
One common approach is to let $\mathbf v$ be some other unit vector orthogonal to $\mathbf u$, and let the rows of $\mathbf R$ be $\mathbf v$, $\mathbf v \times \mathbf u$, and $\mathbf u$.
If your convention is to use column vectors and to pre-multiply by the rotation matrix, then just transpose everything -- the vector $(a,b,c)$ should become the third column of the rotation matrix, instead.