The best way to get the force on an indenter is with the group/group compute:
with one group being the substrate and one being the indenter. I am assuming that your pair_style allows this calculation (i.e. it only has pairwise interactions).
Other things to be careful about are how you cause the indenter to approach the substrate. A good idea is to have fixed atoms on both, which are then given a velocity towards each other. In the example below, the velocity is in the z-direction:
group frozen_bottom molecule 2
velocity frozen_bottom set 0.0 0.0 0.00001 units box
group frozen_top molecule 2817
velocity frozen_top set 0.0 0.0 -0.00001 units box
group frozen union frozen_bottom frozen_top
group mobile subtract all frozen
velocity mobile create 298.0 482934
fix 1 mobile langevin 298.0 298.0 10.0 381293 axes 1 1 0
fix 2 mobile nve
fix 3 frozen setforce 0. 0. 0.