after upgrading CubeMX to version 4.23.0 on linux I noticed a bug in the generation of ./Makefile. The "# paths" section includes *.c files next to the directories and the "# sources" section includes some files twice. You can find an example makefile at [Make] Error in Makefile - Pastebin.com . This leads to compile time errors like
build/stm32f1xx_hal_timebase_TIM.o: In function `HAL_InitTick':
~/workspace/test107/Src/stm32f1xx_hal_timebase_TIM.c:79: multiple definition of `HAL_InitTick'
Please have a look if you can recreate this.