Edit. As Cham has already answered, homogeneity of the Lagrangian is to blame:
$$L(x,\theta \, \dot{x}) = \theta\,L(x, \dot{x})$$ Whenever you have this property, then you have
$$\dot{x}^T\frac{\partial L}{\partial \dot{x}}(x, \dot{x}) = L(x, \dot{x})$$
This is true not only for Lagrangians, this is true for any homogeneous function: if $f(\theta\, x) = \theta\,f(x)$ then $x^T\, \nabla f(x) = f(x)$. Even when people do convex optimization and they end up with such homogeneity, the Legendre transform is ill defined because your homogeneous function is not strictly convex. The solution is to eliminate the homogeneity by restricting to a lower dimensional subspace. The same thing happens in general relativity.
In order to truly successfully perform Legendre's transform, Legendre's map $p = \frac{\partial L}{\partial \dot{x}}(x, \dot{x})$ from the tangent bundle of 4-velocities to the cotangent bundle of generalized 4-momenta, should be bijective (invertable). That's what usually happens in classical mechanics. Since the Lagrangian in the case of general relativity is invariant under the action of the group $\mathbb{R_+}$ acting by rescaling, the Legendre transform is identically zero and the Legendre's map is not invertable, i.e. it maps the time-like tangent cone bundle (dimension 4) into the time-like momenta of constant magnitute (dimesnion 3), where the orbits of the scaling group action are the fibers that get smashed by the Legendre's map. The solution to this is issue is to eliminate the scaling group action by restricting the Lagrnagian onto the time-like unit tangent bundle. Then the Legendre's map is invertable and bijective and things start to work out fine, as explained below.
There is a non-zero Hamiltonain , it is just not constructed as naively and directly as it is in classical mechanics.
Let $\dot{x} = \cfrac{dx}{d\lambda},$ where $\lambda$ is any arbitrary parameter.
Fundamentally, in the philosophy of General Relativity, the parameter $\lambda$ is not of any importance to the theory. Only the shape of the curve $$\gamma = \{x(\lambda) \, : \, \lambda \in [\lambda_1, \lambda_2]\}$$ matters and not the specific parametrization. After all, this curve $\gamma = \{x(\lambda)\}$ is supposed to be a space-time time-like geodesic, which is a geometric property independent of any parametrization $\lambda$, so we really care about the geodesic $\gamma$ as a geometric curve and not as a parametrized curve.
I am going to use a bit of matrix notations, to skip all the indexing. So $$x = \begin{bmatrix} x^i\end{bmatrix} = \begin{bmatrix} x^0\\x^1\\x^2\\x^3\end{bmatrix} \, \text{ and } \, g(x) = \big[g_{ij}(x)\big]_{i,j = 0}^{3} \, \text{ is the 4 by 4 metric tensor} $$
Take your Lagrangian $$L = -m\,\sqrt{- \, \dot{x}^T\,g(x)\, \dot{x}}$$ and define the action
$$S[\gamma] = -m\, \int_{\lambda_1}^{\lambda_2} \, \sqrt{- \, \dot{x}^T(\lambda)\,g\big(x(\lambda)\big)\, \dot{x}(\lambda)}\,d\lambda $$
and look for the critical (non-parametrized!!!) curves
$$\delta S[\gamma] = 0$$
In coordinates $[x^i]$ and with respect to a generic parametrization, the equation $\delta S[\gamma] = 0$ is equivalent to the Euler-Lagrange differential equations
$$\frac{d}{d\lambda}\left(\frac{m}{\sqrt{-\, \dot{x}^T\,g(x)\, \dot{x}}} \,\, g(x)\, \dot{x}\right) \, = \, \frac{m}{2\, \sqrt{-\, \dot{x}^T\,g(x)\,\dot{x}\,}\,}\, \left(\, \dot{x}^T\,\frac{\partial g}{\partial x}(x)\,\dot{x}\, \right)$$ where
$$ \dot{x}^T\, \frac{\partial g}{\partial x}(x)\, \dot{x}\, = \,
\begin{bmatrix}
\frac{\partial g_{ij}}{\partial x^0}(x)\,\dot{x}^i\,\dot{x}^j \\
\frac{\partial g_{ij}}{\partial x^1}(x)\,\dot{x}^i\,\dot{x}^j \\
\frac{\partial g_{ij}}{\partial x^2}(x)\,\dot{x}^i\,\dot{x}^j \\
\frac{\partial g_{ij}}{\partial x^3}(x)\,\dot{x}^i\,\dot{x}^j
\end{bmatrix}$$ for short. Take a solution (time-like) $\gamma = \{ x(\lambda)\, : \, \lambda \}$ of the Euler-Lagrange equations above. As I have already emphasized, the parametrization of $\lambda$ with respect to $\lambda$ is not important for us. Therefore, I can define the function $$\tau = \tau(\lambda) = \int_{\lambda_0}^{\lambda}\, \sqrt{-\, \dot{x}(\zeta)^T \, g\big(\, x(\zeta)\,\big)\, \dot{x}(\zeta)\,}\, d\zeta$$ with derivative
$$\frac{d\tau}{d\lambda} = \sqrt{-\, \dot{x}(\lambda)^T \, g\big(\, x(\lambda)\,\big)\, \dot{x}(\lambda)\,} \, > \,0$$ Thus the function $\tau = \tau(\lambda)$ is strictly increasing and therefore invertable, i.e. there is $\lambda = \lambda(\tau)$. Consequently, we can re-parametrize our solution curve $\gamma$ as $$\gamma = \{ \, x(\tau) \, : \, \tau \, \} \, \text{ where } \, x(\tau)= x\big(\lambda(\tau)\big)$$ Observe that
$$\gamma = \{\,x(\tau)\, : \, \tau \,\} = \{\, x(\lambda)\, : \, \lambda \, \}$$ in other words, this is the same curve in space time, but parametrized in two different ways. Denote $x' = \frac{dx}{d\tau}$. Furthermore,
$$x' = \frac{dx}{d\tau} =\frac{d\lambda}{d\tau} \frac{dx}{d\lambda} = \left( \frac{d\tau}{d\lambda}\right)^{-1} \frac{dx}{d\lambda} = \frac{1}{\sqrt{- \, \dot{x}^T \, g(x) \, \dot{x}}\,}\, \frac{dx}{d\lambda}$$
and in particular $$\frac{d}{d\tau} = \frac{1}{\sqrt{- \, \dot{x}^T \, g(x) \, \dot{x}}\,}\, \frac{d}{d\lambda} $$ Recall that the curve $\gamma$ is a critical curve for the action $S[\gamma]$, i.e. $\delta S[\gamma] = 0$. When $\gamma$ is parametrized with respect to $\lambda$, it's coordinate parametrization $\gamma = \{\, x(\lambda) \, : \, \lambda\}$ solves the Euler-Lagrange equations
$$\frac{d}{d\lambda}\left(\frac{m}{\sqrt{-\, \dot{x}^T\,g(x)\, \dot{x}}} \,\, g(x)\, \dot{x}\right) \, = \, \frac{m}{2\, \sqrt{-\, \dot{x}^T\,g(x)\,\dot{x}\,}\,}\, \left(\, \dot{x}^T\,\frac{\partial g}{\partial x}(x)\,\dot{x}\, \right)$$ whose both sides I can multiply by $\frac{1}{\sqrt{-\, \dot{x}^T\, g(x) \, \dot{x}}\,}$ and obtain the equivalent equations
$$\frac{1}{\sqrt{-\, \dot{x}^T\, g(x) \, \dot{x}}\,} \, \frac{d}{d\lambda}\left(\frac{m}{\sqrt{-\, \dot{x}^T\,g(x)\, \dot{x}}} \,\, g(x)\, \dot{x}\right) \, = \, \frac{m}{-\, 2\, \dot{x}^T\,g(x)\,\dot{x}\,}\, \left(\, \dot{x}^T\,\frac{\partial g}{\partial x}(x)\,\dot{x}\, \right)$$ It is easy to check that with the new parametrization $\gamma = \{\, x(\tau) \, : \, \tau\, \}$ $$\sqrt{-\, \frac{dx}{d\tau}^T \, g(x) \, \frac{dx}{d\tau}} =\sqrt{-\, (x')^T \, g(x) \, x'} = 1$$ Consequrntly, after the reparametrization $\lambda = \lambda(\tau)$ the Euler-Lagrange equations turn into the equivalent simplified equations
$$\frac{d}{d\tau}\left(\, m\, g(x)\, \frac{dx}{d\tau}\right) \, = \, \frac{m}{2}\,\left( \frac{dx}{d\tau}^T\,\frac{\partial g}{\partial x}(x)\, \frac{dx}{d\tau}\,\right) $$ which $\gamma = \{\, x(\tau)\, : \, \tau\,\}$ solves.
In other words we have proven that any solution $\gamma$ to the original Euler-Lagrange equations, after the appropriate reparametrization, solves the simplified Euler-Lagrange equations. In other words, a curve $\gamma$ is a critical curve of the action $S[\gamma]$, i.e. $\delta S[\gamma] = 0$ if and only if it solves the simplified Euler-Lagrange differential equations
$$\frac{d}{d\tau}\left(\,m\, g(x)\, \frac{dx}{d\tau}\right) \, = \, \frac{m}{2}\, \left(\, \frac{dx}{d\tau}^T\,\frac{\partial g}{\partial x}(x)\, \frac{dx}{d\tau}\,\right) $$ where the resulting parametrized solution $\gamma = \{\, x(\tau)\, : \, \tau\,\}$ is paremtrized with respect to proper time, i.e. $\sqrt{ - \, x'(\tau)^T\, g\big(x(\tau)\, x'(\tau)\big)} = 1$ for any $\tau$.
Now, if you set the generalized momenta $$p = m\, g(x) \frac{dx}{d\tau}$$ you get the following doubled system of differential equations
\begin{align}
&p = m\, g(x) \frac{dx}{d\tau}\\
&\frac{dp}{d\tau}\, = \, \frac{m}{2}\, \left(\, \frac{dx}{d\tau}^T\,\frac{\partial g}{\partial x}(x)\, \frac{dx}{d\tau}\,\right)
\end{align} and when you solve the first half with respect to $\frac{dx}{d\tau}$, due to the fact that $g(x)$ is an invertable symmetric matrix, and you substitute in the second half of the equations, you obtain the system of differential equations
\begin{align}
&\frac{dx}{d\tau} = \frac{1}{m}\, g(x)^{-1} \,p\\
&\frac{dp}{d\tau}\, = \, \frac{1}{2m}\, \left(\, p^T\, g(x)^{-1}\,\frac{\partial g}{\partial x}(x)\,g(x)^{-1}\,p\,\right)
\end{align}
These are Hamiltonian equations where the Hamiltonain function is
$$H(x, p) = \frac{1}{2m}\big(p^T\, g(x)^{-1}\, p\,\big)$$
Thus, we have proved that a curve $\gamma$ is a critical curve of the action $S[\gamma]$, i.e. $\delta S[\gamma] = 0$ if and only if it solves the Hamiltonian differential equations with Hamiltonain function $H(x, p) = \frac{1}{2m}\big(p^T\, g(x)^{-1}\, p\,\big)$ where $p = m\, g(x)\, \frac{dx}{d\tau}$.