How is engine thrust measured in flight?
VectorVictor gives the right answer for jets.

However, for propeller aircraft this is really hard, and in the end only the difference between drag and thrust can be measured. By measuring the brake power of the static engine and the drag of the aircraft in a windtunnel, some data points can be acquired which help in calculating what the real thrust in flight could have been.

You are right, in the end it is impossible to produce a precise measurement of thrust. The most important part of the measurement is actually a precise definition of what thrust is: How do you account for the increased friction drag in the propeller slipstream? Is cooling drag part of the airframe drag, or should it reduce thrust? Measuring thrust is foremost an exercise in precise, meticulous bookkeeping.