use standard make mechanism to build
fix open calls

only fopen would take "r" as string, but 'r' is an integer
that maps to RDWR|O_CREAT, which makes it fail to read a .wav from ro mounts
fix compilation on gcc-4.7 / openSUSE 12.3