This may be a solution
Reconfigure Lazarus as sudo
Open a terminal and start Lazarus as sudo with
gksudo StartLazarus
Give your sudo password
In Lazarus choose the menu option
Environment/Rescan FPC source directory
Then , still as sudo - In Lazarus choose the menu option
Tools/BuildLazarus with profile:Build all
After it, the problem above disappears and I can at least create a ButtonClick event handler.
Until the next problem ....