Iterative assembly of $^{171}$Yb atom arrays in cavity-enhanced optical lattices