There is an error in the gcc makefile included with SDK 5.2.0 that prevents it from detecting when a header file has changed and automatically recompiling the C files that include that header. The error is in nrf51_sdk\nrf51822\Source\templates\gcc\Makefile.common.
The line:
Include automatically previously generated dependencies
-include $(addprefix $(OBJECT_DIRECTORY)/, $(COBJS:.o=.d))
should be changed to:
Include automatically previously generated dependencies
-include $(C_OBJECTS:.o=.d)
This line should also be moved below the 'debug' target in the Makefile so that when 'make' is run with no target specified, the 'debug' target is run as the default.