Extending Gareth McCaughan's answer, the farmer can:
Enumerate all the possible options. Draw a diagram with "starting position" on the X axis, and "groundhog speed" on the Y axis. Hit all the points on the integer grid for that diagram.
For example, follow the path:
Start at the red "X" (the origin) on day 1, then follow the arrows to all the grid points.
To determine which hole to illuminate each day:
Pick an arbitrary hole to label hole zero, then number the rest like a number line. The hole ($H$) to illuminate on day $d$ is: $H = x + d \times y$. For example, on day 1, illuminate the arbitrarily chosen hole 0. On day 2, illuminate hole 1. On day 3 illuminate hole 3, etc. On day 16, the grid position is (1,2), so the hole would be number 33.
This ensures that no matter which hole the groundhog started in or how many holes it moves each day, the farmer will eventually catch him.