--- a/mex/Makefile
+++ b/mex/Makefile
@@ -47,7 +47,7 @@ ifneq ($(shell which matlab), )
 endif
 
 # Octave - local install (e.g. compiled from sources) 
-OCTAVE_VERSION 	= -3.4.0
+OCTAVE_VERSION 	= -$(shell octave --version | head -1 | sed -e 's,.* ,,')
 INCOCTAVE 	= -I /usr/local/include/octave$(OCTAVE_VERSION)/octave 
 # Octave - global install  (e.g. from debian package)
 #OCTAVE_VERSION 	= 
