For completeness I'll summarize the answer here. After a fun conversation in the comments, we saw that it will be more illuminating to write
$$H=-\sum_ {i=1}^{N-1}
\sigma_i^x \sigma_ {i+1} ^x + h \sum_ {i=1} ^N \sigma_i^z $$
as
$$ H=-\sum_ {i=1}^{N-1}
\sigma_i^x \sigma_ {i+1} ^x + h\left( \sum_ {i=1} ^{N-1} 1_1 \otimes \cdots 1_{i-1} \otimes \sigma_i^z \otimes 1_{i+1} \otimes \cdots \otimes 1_{N-1} \right)
+ h ( 1_1 \otimes \cdots \otimes 1_{N-1} \otimes \sigma^z_N) $$
where it is understood that (to prevent clutter)
$$ \sigma_i^x \sigma_{i+1}^x = 1_1 \otimes \cdots\otimes 1_{i-1} \otimes \sigma^x_i \otimes \sigma^x_{i+1} \otimes 1_{i+2} \otimes \cdots \otimes 1_{N} $$
and the subscripts are there to denote nothing more than the position of insertion (i.e. they are all $2\times 2$ identity)
We then create a matrix from the direct product of matrices $A,B$ where $[A] = m \times n$ and $[B] = p \times q$ matrices
$$ \mathbf {A} \otimes \mathbf {B} ={\begin{bmatrix}a_{11}\mathbf {B} &\cdots &a_{1n}\mathbf {B} \\\vdots &\ddots &\vdots \\a_{m1}\mathbf {B} &\cdots &a_{mn}\mathbf {B} \end{bmatrix}}. $$
We apply this to the $i^{th}$ term and then loop over all $i$ to achieve the desired matrix.