tidy/fix some small stuff
add missing libs back to Makefile
fix block_work() calculation function.