Fix build system under Ubuntu 13.10. Closes #1061 #1130 #1124.