Besides my comment above, according to this the maximum lag length can be chosen by rule of a thumb formula:
$$
P_{max}=[12.(\frac{T}{100})^{1/4}]
$$
See page 121 in the above referenced link:
An important practical issue for the implementation of the ADF test is
the specification of the lag length p. If p is too small then the
remaining serial correlation in the errors will bias the test. If p is
too large then the power of the test will suffer. Ng and Perron (1995)
suggest the following data dependent lag length selection procedure
that results in stable size of the test and minimal power loss. First,
set an upper bound pmax for p. Next, estimate the ADF test regression
with p = pmax. If the absolute value of the t-statistic for testing
the significance of the last lagged difference is greater than 1.6 then
set p = pmax and perform the unit root test. Otherwise, reduce the lag
length by one and repeat the process. A useful rule of thumb for determining pmax,
suggested by Schwert(1989), is
$$
P_{max}=[12.(\frac{T}{100})^{1/4}]
$$