Remove unnecessary "implicit none"

It is enough to write it once at the module level, then it automatically
applies to all subroutines.
Fix Makefile to compile in Ubuntu

The -lgfortran must go to the end of the line.
Use "dp" for double precision

This is the recommended way.
Don't use 0.d0, but either 0 or 0._dp

In this particular case, we simply assign 0 (integer) to the floating point
number.
Simpler syntax for function declaration
Use matmul for matrix-vector multiply
Remove spurious allocate statements

These statements seem to leak memory, since they allocate the pointer and then
the pointer is assigned to other value.
Merge pull request #3 from certik/small_fixes

Polish the Fortran code