i use external white mastic sealer as used by builders for sealing around windows being flexible run it along the edge of the rail you will have to re-do it at some stage.
To go the whole way go to caravan shop for some none setting sealant putty remove the rails and re-place the existing putty the screws for most types of rail are under the black strip in centre of rails use vaselene on new screws and to aid re-fit if the back strip. Vaselene known as Petrolium jelly is a clean lubricant.
Try the window rubbers top section with gutter mastic peel back the rubber squeazing in the mastic as you go. little at a time and most excess will come off with white spirit.
With holes in the roof cut out white disc of plastic from thin cladding strips bought at Wickes DIY with cheap hole cutter set and mastic them on each hole with external mastic using for the rail (white). It will stick well but still be flexible.
hope this helps.
bob, March 2013