Good morning, Tony;
There is a problem; the lens registration distance for the M-39 Leica Thread Mount is only 28.80mm, while the M-42 UTM/Pentax/Contax-S/Praktica/et cetera has a lens registration distance of 45.46mm. The M-42 Mount is much further away from the focal plane than the M-39 mount. This quickly translates to an inability to make the M-39 lens come to focus at infinity on an M-42 camera; you cannot get the M-39 lens close enough to the film plane on the M-42 camera. The M-39 mount was designed for a rangefinder camera; there is no swinging mirror to clear the back of the lens while swinging up out of the light path to the film plane.
You can use the M-39 lenses for close-up work on an M-42 camera just as they are.
OK. That is the general problem with just saying that you need an M-39 lens to M-42 camera body adapter tube.
However, the Heinz Kilfitt 5.6/600mm lens that you have I believe is intended for use with the VisoFlex housing that goes onto the front of an M-39 LTM rangefinder camera. The VisoFlex is an adapter system that has its own mirror and viewing system to allow you to focus the very long telephoto lens while using it with a rangefinder camera body. You might see if you can find the VisoFlex adapter housing that is intended for use with your lens and at least measure it. In this special and specific case with your lens, you could have a machinist make up a special M-39 LTM to M-42 UTM adapter tube with a length to match the VisoFlex housing length minus the difference between the M-42 lens registration and the M-39 lens registration. Make sure that the machinist does understand that the length specification for the face to face distance of the adapter is a Plus Zero or Nothing and Minus a reasonable tolerance; it can be a little bit shorter, but it cannot be longer. That would allow you to reach focus at infinity with the lens, and you can use the normal Asahi Pentax camera mirror system to watch what happens as you focus the telephoto lens. The back of the adapter will take the standard M-42 specification of 42mm diameter by 1.00mm thread pitch. You need to check and confirm that the Kilfitt lens does have the M-39 LTM specification of 39mm diameter with 26 tpi Whitworth pattern threads. Also, you might ask some of the older guys with the Leica cameras on the Rangefinder Forum if they can help with the measurements you need.
And, it will be a manually operated lens; no automatic operation of the lens diaphragm to stop down just before taking the photograph. You need to close the lens aperture to the taking f-stop just before you release the shutter.
This will be an interesting project.