*Is there a way to get the $\mathbb{Z }$ homology via Morse Homology?* Sure, indeed, historically, the underlying ideas and constructions by means of flow lines were one of the first attempt to build concretely the homology of a manifold. Actually, it seems to me that this construction was a little abandoned for a while, especially by functional analysts, because the alternative Morse theory by means of *sublevel sets*, popularized e.g. by Richard Palais in the '60, was somehow simpler, as it did not use transversality arguments. Then the Morse complex and homology construction became suddenly in fashion again after Andreas Floer's work, in which it became a spectacular tool to build new invariants aimed to prove the Arnold conjecture.

In any case, yes, you can certainly perform the Morse complex construction with $\mathbb{Z}$ coefficients for a $C^2$ functional $f$, even on a possibly infinite dimensional Hilbert manifold $M$, and prove that the resulting homology is isomorphic to the singular, *provided* the functional enjoys a list of properties (some of them are given for free in the case of compact manifolds).

Specifically, it should be bounded from below; have nondegenerate critical points (i.e., with invertible Hessian operator) with finite Morse indices; it should have complete sublevel sets, and lastly, it should satisfy the Palais-Smale compactness condition (PS). Up to a $C^{\infty}$-small perturbation of the metric, as an application of the Sard-Smale theorem, you may even assume that the negative gradient flow of $f$ has the property that for any pair of critical points $x$ and $y$, whose Morse indices $m(x)$ and $m(y)$ differ at most by 2 (that's a techical detail), the unstable manifold $W^u(x)$ of $x$ and the stable manifold $W^s(y)$ of $y$ meet transversally.

As a consequence, these intersections are flow-invariant, embedded submanifolds of dimension equal to $m(x)$ - $m(y)$ (thus empty if $m(x)$ $\leq$ $ m(y)$). And *orientable* in a canonical way, starting from arbitrarily choosen orientations of all unstable manifolds of critical points (the unstable manifold of a critical point is an embedded submanifold diffeomorphic with its tangent space, whose dimension coincides with the Morse index of the critical point). Note: these intersections are in any case orientable, even if $M$ is not. Moreover, if $m(x)-m(y)\leq1$, they meet any regular level set of $f$ in a compact set (thus finite).

As you probably know, this allows to define $C_k(f)$ as the free abelian group generated by the (possibly infinite) set $\mathrm{crit}_k(f)$ of all critical points of index $k$; moreover a boundary operator $$\partial:C_k(f)\to C_{k-1}(f)$$

is well-defined by linear extension starting from the generators $\mathrm{crit}_k(f)$. It just sends $x\in \mathrm{crit}_k(f)$ to a certain algebraic sum of the endpoints $y$ of all flow lines emanating from $x$ at time $-\infty$, and converging to critical points $y$ of index $m(x)-1$ at time $+\infty$. The mentioned compactness property ensures that there are finitely many of these flow lines; and the sign in front of any $y$ in the sum is chosen to be + or - according whether the orientation of $W^u(x)\cap W^s(y)$ coincides or not with the one induced by the gradient flow. Then one proves that this way one has really defined a true boundary, that is, the relation $\partial^2=0$ hold. Finally, one proves that the corresponding complex produces the singular homology. And this is the Morse homology with $\mathbb{Z}$ coefficients. (it is not completely clear to me whether your query was on the general side, or particularly aimed to your specific function. I hope recalling the general facts may be in any case of some aid.)

*Warning.* Actually this is one of the way pepole tell the story; it involves not too many technicalities (if you do it well), but everything looks like a kind of magic. In fact, the whole story should start by a *cellular decomposition* induced by the functional; this puts the isomorphism of the homologies into a more general and natural fact about cellular homologies (if you want to understand Morse homology, read chapter 5 of Albrecht Dold's *Lectures on Algebraic Topology*, on cellular spaces and cellular complexes); and then the nice picture of the Morse complex with points and lines becomes rather a *representation* (of the cellular complex) than a smart construction, which is even closer to the historical developement of these ideas by giants like Morse, Bott, Thom, Smale.