how to make CIC compensation filter
I have a simple compensation approach that I've used to implement a reasonable estimate of an inverse $\textrm{sinc}$ for use as a CIC compensator as well as other inverse $\textrm{sinc}$ applications. This approach makes use that the $\textrm{sinc}$ function in the passband can be reasonably approximated by a weighted cosine function. Therefore a raised cosine function in frequency, meaning $b-(\alpha)cos(\omega)$ can be used in cascade with the CIC filter as compensation. This function is adjusted by changing the cosine weight $\alpha$ while keeping $b=1+\alpha$, such that the mean squared error over the passband of interest of the cascaded result is minimized.

Once the minimized passband is established, (you can do this with least squared minimization techniques, but I have done it quickly by evaluating passband error for a least squared miminum while doing a binary search on $\alpha$ values, which quickly converges to an $\alpha$ value that minimizes the error for a given passband), the coefficients of the filter, which is the filter impulse response, are as follows:

Coeff 1, 3: $-\alpha/2$

Coeff 2: $b= 1 + \alpha$

It is that easy!  The filter is a simple 3 tap FIR with coefficients [$(-\alpha/2)$   $(1+\alpha)$   $(-\alpha/2)$]. Since the filter is symmetric, it can also be implemented with just two multipliers as shown in the figure. Symmetric filters also have the nice benefit that they are linear phase.  



See the figure below for an example of using this CIC compensator in an x8 CIC Intepolator.  In use, the signal is passed through the 3 tap compensator at the lower rate, and then fed into the x8 CIC Interpolator with an output at 8x the sample rate.  The cascaded response shows the significant improvement that can be achieved with this simple compensator. 

What should now be clearer from this figure is that this compensation approach will slightly decrease overall rejection in portions of the stop band. (For this specific example the decrease was on the order of 1.6 dB). However, since the unity gain positions of the compensator will be aligned with the null locations in the CIC response, this reduction in rejection is not in those rejection regions that matter most for CIC rate conversion.  



Here is a zoom in of the passband showing the excellent flatness that can be achieved with three taps!



Note on solving for the FIR coefficients from the first figure above.

The coefficients being the impulse response of the filter are determined from the inverse DFT of the frequency response. They can be quickly derived from the generic equation for the frequency response for an FIR filter in terms of the FIR coefficients as:

$H(\omega)= \sum_{n=0}^{N-1}c_ne^{-jn\omega}$

where $c_n$ are each of the $N$ coefficients, and $\omega$ is the digital frequency domain from $0$ to $2\pi$ corresponding to 0 Hz to the sampling rate.  

As for the case of our 3 tap symmetric FIR this is 

$H(\omega)= -\frac{\alpha}{2}+ be^{-j\omega}-\frac{\alpha}{2}e^{-j2\omega}$

$ = e^{-j\omega}(-\frac{\alpha}{2}e^{+j\omega}+b-\frac{\alpha}{2}e^{-j\omega})$

$=e^{-j\omega}(b-\alpha(\frac{e^{+j\omega}+e^{-j\omega}}{2}))$

$=e^{-j\omega}(b-\alpha cos(\omega))$

which is exactly the desired frequency response as given in the first plot (the first term $e^{-j\omega}$ is just the required delay for the filter to be causal but does not affect the magnitude response (and shows how the phase is linear versus $\omega$ ...the same reason all symmetric FIR filters are linear phase- the response for any symmetric FIR can all be described in terms of cosines with a linear phase delay pulled out of the equation!).

It may be more intuitive to some imagine this operation when going from the time domain to the frequency domain if you are familiar with the FT of a cosine wave: A raised cosine wave in the time domain (meaning a cosine with a DC offset) has a Fourier tranform with 3 impulse components in the frequency domain; a DC term, and a positive and negative frequency term. Likewise, the same waveform in the frequency domain will have three impulse components in the time domain, and these components are the impulse reponse by definition, which are therefore the filter coefficients.