I was playing with nrf51 dongle some more and I stumbled on some troubles, so debugging would be handy. After some playing around I found out you need to add following to Makefile:
CFLAGS += -D__HEAP_SIZE=0 CFLAGS += -DBSP_UART_SUPPORT ASMFLAGS += -D__HEAP_SIZE=0 ASMFLAGS += -DBLE_STACK_SUPPORT_REQD ASMFLAGS += -DBSP_UART_SUPPORT
After that you just use whatever you need for debugging in the code (e.g. printf).
The result can be read on serial terminal over the USB port (e.g. minicom). You need to set the speed to 38400).