It seems from your description that you don't need to actually compute the matrix, but just insure that the necessary and sufficient conditions exist for one to be computed. For that, I think that all you'll need is J. H. Ryser's paper, "Combinatorial properties of matrices of zeros and ones." You may also find Richard A. Brualdi's paper "Matrices of zeros and ones with fixed row and column vectors" very readable.
Applying those, we first establish some terminology. As you've already said, the matrix ${\bf A}$ is an $m \times n$ (where $m$ and $n$ are positive integers) matrix of ones and zeros. Further, we have row and column sum vectors ${\bf R} = (r_1,\dots,r_m$) and ${\bf S}=(s_1,\dots,s_n)$ which are nonnegative integral vectors. First, it's clear that if there are $\tau$ ones in the matrix ${\bf A}$, then $\displaystyle \tau = \sum_{i=0}^{m}r_i = \sum_{j=0}^{n}s_j$. If that condition fails, then obviously the answer is "no."
If that succeeds, then following Brualdi, we can define a function to help with the evaluation. First, let $I \subseteq \left\{ 1,\dots,m \right\}$ and $J \subseteq \left\{1,\dots, n \right\}$. Define $\displaystyle t(I,J) =|I||J|+\sum_{i \notin I}r_i - \sum_{j \notin J}s_j$. All that remains is to demonstrate that $t(I,J) \ge 0$ for all $I\subseteq\left\{1,\dots,m\right\}$ and $J\subseteq\left\{1,\dots,n\right\}$.
A "standard" generator matrix of a $[n,k]$ code usually means that we seek a $k\times n$ matrix $G$ of the form $$G = \left[I_{k\times k}\ P_{k\times (n-k)}\right]$$ where $I_{k\times k}$ denotes a $k\times k$ identity matrix. For a $[7,6,2]$ code, $P_{6\times 1}$ is just a column of $6$ bits, and I leave it to you to figure what the six bits must be in order for the code to have minimum distance $2$. Do it; write out an arbitrary 6-bit column on the right of a $6\times 6$ identity matrix. Then, step back and admire the $6\times 7$ matrix that you
have written down, and ponder the fact that each row of $G$ is a codeword.
Best Answer
One approach is to use integer linear programming (ILP) as follows. Let $r_i$ and $c_j$ be the desired row and column sums, respectively. Let binary decision variable $B_{i,j}$ be the entry in row $i$ and column $j$. The constraints are \begin{align} \sum_j B_{i,j} &= r_i &&\text{for all $i$}\\ \sum_i B_{i,j} &= c_j &&\text{for all $j$}\\ \end{align} Branch-and-cut is the most common algorithm for ILP, but it turns out that for your problem the linear programming relaxation always yields an integer solution. This particular problem is known as the transportation problem, with a supply node for row $i$ and a demand node for column $j$, and the variable $B_{i,j}$ represents the "flow" from node $i$ to node $j$. Usually the transportation problem has a linear objective function $\sum_{i,j} c_{i,j} B_{i,j}$ to be minimized, but yours is a feasibility problem; you can think of this as taking $c_{i,j}=0$ as the cost.
For your sample data, here is one such matrix: